Detect linked issues at the end of PR bodies in provider testing issue - #70396
Conversation
The provider testing issue generator missed linked issues when the reference was the last thing in the PR body (a common shape: "Fixes character after the number, which does not exist at end of string, so the reference was silently dropped and the release manager had to add the issue to the testing issue by hand (e.g. apache#53843 for the google 22.3.0rc1 issue). A negative lookahead matches the same references without needing a trailing character.
0924b00 to
f21538d
Compare
potiuk
left a comment
There was a problem hiding this comment.
Good catch — the old [^0-9] needed a trailing character to exist, so a reference as the last thing in the body was silently dropped. Lookahead is the right fix. I traced both call sites (release_management_commands.py:2925 and :4749), and the parametrized cases genuinely fail against the old pattern, so the test earns its place.
Worth noting the fix quietly cures a second bug the description doesn't mention: because [^0-9] consumed a character, adjacent references lost the separator the next match needed — on #111 #222 the old pattern matched #111, ate the space, and then missed #222 entirely.
Two nits inline, neither blocking; approving.
This review was drafted by an AI-assisted tool and
confirmed by an Airflow maintainer. The maintainer
approving this PR has read the findings and signed off. If
something feels off, please reply on the PR and a maintainer
will follow up.More on how Airflow handles maintainer review:
contributing-docs/05_pull_requests.rst.
Drafted-by: Claude Code (Opus 5); reviewed by @potiuk before posting
The old pattern consumed the separator character, so back-to-back references like "apache#111 apache#222" lost the second one — a test case now pins the fixed behaviour. The byte-identical dead copy of ISSUE_MATCH_IN_BODY in dev/assign_cherry_picked_prs_with_milestone.py is removed so grep leads only to the live definition. Generated-by: Claude Code (Fable 5)
Backport failed to create: v3-3-test. View the failure log Run detailsNote: As of Merging PRs targeted for Airflow 3.X In matter of doubt please ask in #release-management Slack channel.
You can attempt to backport this manually by running: cherry_picker 9f8629c v3-3-testThis should apply the commit to the v3-3-test branch and leave the commit in conflict state marking After you have resolved the conflicts, you can continue the backport process by running: cherry_picker --continueIf you don't have cherry-picker installed, see the installation guide. |
The provider testing issue generator (
breeze release-management generate-issue-content-providers) silently missed linked issues whose reference is the last thing in the PR body — a common shape, sinceFixes #NNNNNoften sits on the final line.ISSUE_MATCH_IN_BODY(r" #([0-9]+)[^0-9]") requires a non-digit character after the number, which doesn't exist at end of string after the body's lines are joined.Concrete occurrence: in the google 22.3.0rc1 testing issue (#70355), PR #69161 (body ending with
Fixes #53843) was rendered with no linked issues, and the release manager had to add #53843 by hand.Replacing the trailing
[^0-9]with a negative lookahead(?![0-9])matches the same references without requiring a trailing character. Verified against the real #69161 body: the old pattern finds nothing, the new one finds 53843; mid-body references behave identically.Was generative AI tooling used to co-author this PR?
Generated-by: Claude Code (Fable 5) following the guidelines